\chapter{Test Cases}
\label{cap:testcase}

\section{Modify User Abilities}

	\subsection{Add a new ability}
		\begin{itemize}
		 \item \textbf{Goal}: Add a new ability to the user's profile.
		 \item \textbf{Operating environment}: Edit profile page.
		 \item \textbf{Input}: An extra Ability has been selected.
		 \item \textbf{Expected result}: The ability has been added to user profile and correctly persisted on the database.
		 \item \textbf{Obtained result}: Everything as expectations.
		 \item \textbf{Final result}: The page shows the message "Profile edited" and show a link to the homepage
		 \item \textbf{Notes}: Nothing important.
		 \end{itemize}
	
	\subsection{Remove some abilities}
		\begin{itemize}
		 \item \textbf{Goal}: Remove an ability from the user's profile.
		 \item \textbf{Operating environment}: Edit profile page.
		 \item \textbf{Input}: Some abilities has been de-selected.
		 \item \textbf{Expected result}: All abilities selected are removed from user's profile.
		 \item \textbf{Obtained result}: All abilities are removed, but only if remeins at leats one ability to the user. 
		 \item \textbf{Final result}: If i leave at least one ability to the user, the system shows the message "Profile Edited", else the system shows an error page.
		 \item \textbf{Notes}: The RASD document explicity states that a user can have an empty set of abilities, but the system doesn't support this feature
		\end{itemize}
		
	 
	 \subsection{Add and modify data}
		\begin{itemize}
			\item \textbf{Goal}: Adding a new ability and modify data together.
			\item \textbf{Operating environment}: Modify Profile Page
			\item \textbf{Input}:random value in the text fileds, remove an old ability and set a new one.
			\item \textbf{Expected result}: My user shold have all the field modified according to my random value plus the removed ability should be actually removed and the new one should be added.
			\item \textbf{Obtained result}: Everything as expectations.
			\item \textbf{Final result}: I got redirected to a page where a message of success is shown. From that page I'm able to go back to home page.
			\item \textbf{Notes}: According to expectations after adding an ability, I am able to find this user when i look for the user with that ability both in the normal and advanced research, further i am no more able to find him by looking for his old deletted abilities. 
		
		\end{itemize}

\section{Add Friends}

	\subsection{Add friends after a reserch}
		\begin{itemize}
		 \item \textbf{Goal}: Send a friendship request after searching friends.  
		 \item \textbf{Operating environment}: searched friend's profile.
		 \item \textbf{Input}: click on the link Add to friends.
		 \item \textbf{Expected result}: The friendship request has been sent.
		 \item \textbf{Obtained result}: Everything as expectations.
		 \item \textbf{Final result}: The system shows the message "Friendship Requested" and to links, one to go back to the user's profile and one to go to the home.
		 \item \textbf{Notes}: I can't, correctly, ask friendship to users that are already my friends, or to users that have sent to me a friendship request.
		 \end{itemize}
	
	\subsection{Add suggested friends}
		\begin{itemize}
		 \item \textbf{Goal}: Send a friendship request from suggested users.
		 \item \textbf{Operating environment}: Suggested friends page, reachable from the homepage, when a user accept you're friendship, or after accepting new friendship requests;
		 \item \textbf{Input}: Click on one of suggested friends, and then click on the link Add to friends.
		 \item \textbf{Expected result}: The friendship request has been sent.
		 \item \textbf{Obtained result}: Everything as expectations.
		 \item \textbf{Final result}: The system shows the message "Friendship Requested" and to links, one to go back to the user's profile and one to go to the home.
		 \item \textbf{Notes}: The system shows as suggested users some people that i can't add to friends for many reasons (already friends, friendship already asked or received).
		\end{itemize}
	

\section{Accept friendship request}
	
	\subsection{Accept a request}
		\begin{itemize}
		 \item \textbf{Goal}: Accept a user as friend.
		 \item \textbf{Operating environment}: The user home.
		 \item \textbf{Input}: Click on the link accept, below the desired user.
		 \item \textbf{Expected result}: The user has been added as friend.
		 \item \textbf{Obtained result}: Everything as expectations.
		 \item \textbf{Final result}: The system a page with a list of suggested friends, if any, or a message saying that there aren't suggested friends.
		 \item \textbf{Notes}: Nothing important.
		 \end{itemize}
	
	\subsection{Refuse a request}
		\begin{itemize}
		 \item \textbf{Goal}: Refuse a friendship request
		 \item \textbf{Operating environment}: The user home.
		 \item \textbf{Input}: Click on the Deny link below the desired user.
		 \item \textbf{Expected result}: The help request disappear.
		 \item \textbf{Obtained result}: Nothing happens.
		 \item \textbf{Final result}: Nothing happens.
		 \item \textbf{Notes}: The Deny fuction is useless, because i can then accept a friendship request already refused.
		 \end{itemize}


\section{Collaboration Search Among Friends}
	
	\subsection{Request Collaboration After Advanced Search}
		\begin{itemize}
		 \item \textbf{Goal}: Search a user by ability, among friends.
		 \item \textbf{Operating environment}: The user Home.
		 \item \textbf{Input}: Click on advanced search, write an ability name, set filter by to "by skill" and among to "friends". Then click on the user profile and select an ability, the click on Request.
		 \item \textbf{Expected result}: An ability request has been sent to the desided user.
		 \item \textbf{Obtained result}: Everything as expectations.
		 \item \textbf{Final result}: The system shows the message "Collaboration Requested" and to links, one to go back to the user's profile and one to go to the home.
		 \item \textbf{Notes}: Not so much to be tested, because the input skill to be requested are set by the application. System allows to ask muliple collaboration request of the same or different skills. Works also after a symple search.  Self Collaboration request are accepted by the system, that is a possible undesirable behavior.
		 \end{itemize}

\section{Accept Collaboration}
	
	\subsection{Accept Collaboration}
		\begin{itemize}
		 \item \textbf{Goal}: Accept a collaboration.
		 \item \textbf{Operating environment}: The user Home.
		 \item \textbf{Input}: Click on Accept link next to the name of one user asking collaboration.
		 \item \textbf{Expected result}: The collaboration request has been accepted.
		 \item \textbf{Obtained result}: Everything as expectations.
		 \item \textbf{Final result}: The homepage without the collaboration request.
		 \item \textbf{Notes}: The collaboration Request is also corrrectly persisted in the database. It's impossible to know much more than the name of the person asking for help, and so multiple help request from the same person can be only blind accepted/refused from the answering user. Accepting to much collaborations In the same day will break the layout of the page.
		 \end{itemize}
	
	\subsection{Refuse Collaboration}
		\begin{itemize}
		 \item \textbf{Goal}: Refuse collaboration.
		 \item \textbf{Operating environment}: The user Home.
		 \item \textbf{Input}: Click on Deny link next to the name of one user asking collaboration.
		 \item \textbf{Expected result}: The collaboration request is not shown anymore in the list.
		 \item \textbf{Obtained result}: Everything as expectations.
		 \item \textbf{Final result}: The homepage without the collaboration request.
		 \item \textbf{Notes}: The collaboration Request is also removed corrrectly from the database.
		 \end{itemize}





